// import * as THREE from "three";
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader"; 
import { DRACOLoader } from "three/examples/jsm/loaders/DRACOLoader";

var scene;
// var renderer;
function init(xscene) {
  scene = xscene;
  // renderer = xrenderer
  setModel();
}
function setModel() {
    const dracoLoader = new DRACOLoader();
    dracoLoader.setDecoderPath("/static/draco/");
    console.log('dracoLoader',dracoLoader)
    
    const loader = new GLTFLoader();
    loader.setDRACOLoader(dracoLoader);
    console.log('loader',loader)
    loader.load(
      "/static/models/LittlestTokyo.glb",
      (gltf)=>{
        const model = gltf.scene;
        model.position.set(1, 1, 0);
        model.scale.set(0.01, 0.01, 0.01);
        scene.add(model);
        // console.log("++++2", gltf);
        // mixer = new THREE.AnimationMixer(model);
        // mixer.clipAction(gltf.animations[0]).play()
      }
    );
}



export { init };
